package xidian.vlab.domin.User;

import org.hibernate.tuple.VmValueGeneration;
import xidian.vlab.domin.VMachine;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Entity
public class Student {
    @Id
    private Long sid;
    private Long cid;
    private String name;
    private String password;
    private String email;

    @OneToMany(mappedBy = "student", cascade = CascadeType.ALL)
    private List<VMachine> machines = new ArrayList<>();


    //////////////////////////////////////////////////////

    public Long getSid() {
        return sid;
    }

    public void setSid(Long sid) {
        this.sid = sid;
    }

    public Long getCid() {
        return cid;
    }

    public void setCid(Long cid) {
        this.cid = cid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public List<VMachine> getMachines() {
        return machines;
    }

    public void setMachines(List<VMachine> machines) {
        this.machines = machines;
    }

    @Override
    public String toString() {
        return "Student{" +
                "sid=" + sid +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", machines=" + machines +
                '}';
    }
}
